<!-- 关闭Tab时顶部标题 -->
<div class="layui-body-header">
    <span class="layui-body-header-title"></span>
    <span class="layui-breadcrumb pull-right">
        <a href="#/">首页</a>
        <a><cite></cite></a>
    </span>
</div>

<div class="admin-iframe" style="height: auto;-webkit-overflow-scrolling: touch;">
    <iframe id="adminIframe" class="admin-iframe" frameborder="0"></iframe>
</div>

<!-- js部分 -->
<script>
    layui.use(['layer', 'index'], function () {
        var $ = layui.jquery;
        var layer = layui.layer;
        var index = layui.index;

        var id = layui.router().search.id;
        if ('baidu' == id || 'baidu2' == id) {
            index.setTabTitle({title: '百度一下'});
            $('#adminIframe').attr('src', 'https://baidu.com');
        } else if ('laydemo' == id) {
            index.setTabTitle({title: '组件演示'});
            $('#adminIframe').attr('src', 'https://www.layui.com/demo/button.html');
        } else if ('layui' == id) {
            index.setTabTitle({title: 'layui文档'});
            $('#adminIframe').attr('src', 'https://www.layui.com/doc/element/button.html#use');
        } else if ('layer' == id) {
            index.setTabTitle({title: 'layer弹窗组件'});
            $('#adminIframe').attr('src', 'https://layer.layui.com/');
        } else if ('laydate' == id) {
            index.setTabTitle({title: 'laydate日期组件'});
            $('#adminIframe').attr('src', 'https://www.layui.com/laydate/');
        }
    });
</script>